Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Release PR actions #76

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add Release PR actions #76

wants to merge 3 commits into from

Conversation

samuelburnham
Copy link
Member

@samuelburnham samuelburnham commented Sep 20, 2024

Adds composite actions for an automated release PR and associated tag + GitHub release when the release PR is merged. Builds on prior work in collaboration with @tchataigner (1, 2)

release-pr.yml

Major/minor release

  • Triggered manually on workflow_dispatch, with major or minor as the release-type input
  • Checks out the latest compatible release/<tag-prefix>-v<version> branch, e.g. release/aptos-v1.0. Note that release/ branches omit the SemVer patch version, as they are meant to persist for production and will iteratively incorporate any patches/hotfixes.
  • Creates and pushes a new branch that increments the version number in the branch name only, e.g. release/aptos-v1.1
  • Creates a new branch called release-pr that increments the version number in Cargo.toml, e.g. 1.0.0 to 1.1.0
  • Opens a PR from release-pr to the new release/ branch. This allows for CI, PR review, and any additional commits to be added for the release. These commits should generally be cherry-picked from existing commits to the default branch.
  • On merge, triggers the tag-release workflow. The release-pr branch can be safely deleted, but the release/ branch should be kept as the release source.

Patch release

  • Triggered manually on workflow_dispatch, with patch as the release-type input
  • Checks out the latest compatible release/<tag-prefix>-v<version> branch, e.g. release/aptos-v1.0
  • Creates and pushes a new branch called patch/<tag-prefix>-v<version>.<patch-version>, e.g. patch/aptos-v1.0.1, which increments the version number in Cargo.toml accordingly
  • Opens a PR from the patch/ branch to the new release/ branch. This allows for CI, PR review, and any additional commits to be added for the release.
  • On merge, triggers the tag-release workflow. The patch/ branch can be safely deleted, but the release/ branch should be kept as the release source.

tag-release.yml

  • Intended to trigger automatically by the release-pr caller when the release PR is merged, as it relies on the head and base branch names for tagging.
  • Tags the base branch of the PR with the new release version
  • Gets the changelog from the previous release tag to the current tag
  • Creates a GitHub release for the new version, tag, and changelog

Downstream examples

Successful runs

TODOs

  • Add unique ID to PR branch name, e.g. release-pr-- in order to allow multiple release PRs at once
  • Auto-open PR to the default branch to bump the Cargo.toml version if this is the latest major.minor release
  • Add an automatic labeler for PRs based on title/commit prefix. This will enable changelogs to categorize changes more accurately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant